﻿import TextField.StyleSheet;
class com.utils.CustomStyleSheet extends TextField.StyleSheet {
	// extend transform() method
	
	private function transform(p_style_obj:Object):TextFormat {
		//trace("custom.transform()");
		// first call super.transform()
		var _fmt:TextFormat = super.transform(p_style_obj);
		// second, map our custom css properties to TextFormat properties
		for (var prop:String in p_style_obj) {
			if (prop == "leading") {
				// leading
				_fmt.leading = p_style_obj[prop];
				delete p_style_obj[prop];
			} else if (prop == "tabstops") {
				// tabStops
				_fmt.tabStops = p_style_obj[prop].split(",");
				delete p_style_obj[prop];
			} else if (prop == "blockindent") {
				// blockIndent
				_fmt.blockIndent = p_style_obj[prop];
				delete p_style_obj[prop];
			}
		}
		return _fmt;
	}
}